<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ExperienceModel extends Model
{
    //心得
    protected $table='experience';

    public function getRouteLineAttribute($extra)
    {
        return array_values(json_decode($extra, true) ?: []);
    }

    public function setRouteLineAttribute($extra)
    {
        $this->attributes['route_line'] = json_encode(array_values($extra));
    }

}
